package com.education.welco.service.impl;

import com.education.welco.mapper.OrderQuestionMapper;
import com.education.welco.pojo.OrderQuestion;
import com.education.welco.service.OrderQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试题表 服务层实现
 *
 * @author d
 * @date 2021-03-04 15:45:19
 */
@Service
public class OrderQuestionServiceImpl implements OrderQuestionService {

    @Autowired
    private OrderQuestionMapper orderQuestionMapper;

    //查询试题表信息
    @Override
    public OrderQuestion selectOrderQuestionById(Integer id) {
        return orderQuestionMapper.selectOrderQuestionById(id);
    }

    //根据试卷ID查询试题表信息
    public List<OrderQuestion> selectOrderQuestionByPaperId(Integer paperId,Integer questionType){
        return orderQuestionMapper.selectOrderQuestionByPaperId(paperId,questionType);
    }

    // 查询试题表列表
    @Override
    public List<OrderQuestion> selectOrderQuestionList(OrderQuestion orderQuestion) {
        return orderQuestionMapper.selectOrderQuestionList(orderQuestion);
    }

    // 新增试题表
    @Override
    public int insertOrderQuestion(OrderQuestion orderQuestion) {
        return orderQuestionMapper.insertOrderQuestion(orderQuestion);
    }

    //修改试题表
    @Override
    public int updateOrderQuestion(OrderQuestion orderQuestion) {
        return orderQuestionMapper.updateOrderQuestion(orderQuestion);
    }

    //删除试题表对象
    @Override
    public int deleteOrderQuestionByIds(String[] ids) {
        return orderQuestionMapper.deleteOrderQuestionByIds(ids);
    }

    @Override
    public int deleteOrderQuestionById(Integer id) {
        return orderQuestionMapper.deleteOrderQuestionById(id);
    }

    @Override
    public String[] selectIdsByType(Integer type) {
        return orderQuestionMapper.selectIdsByType(type);
    }

    @Override
    public String[] selectIdsByTypelf(Integer type,String catalogId) {
        return orderQuestionMapper.selectIdsByTypelf(type,catalogId);
    }

    //获取目录id
    @Override
    public List<Integer> selectCatalogIdList(String name) {
        return orderQuestionMapper.selectCatalogIdList(name);
    }
}